package com.videolib.db;

import java.sql.*;
import java.util.ArrayList;


public class DatabaseConnection {

	Connection con = null ;
	Statement stmt = null;
	Statement stmt2 = null;
	private static final String CONNECTIONURL = "jdbc:mysql://localhost:3306/sample";
	private static final String USERNAME	  = "root";
	private static final String PASSWORD	  = "*****";
	
	
	

	DatabaseConnection()
	{
		init();
	}


	private void init()
	{	
		try
		{
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			con = DriverManager.getConnection(CONNECTIONURL,USERNAME,PASSWORD);
			stmt = con.createStatement();
			stmt2= con.createStatement();
			if(!con.isClosed())
				System.out.println(" ");
		} catch(SQLException e)
		{
			e.printStackTrace();
		}
		catch (InstantiationException e)
		{
			e.printStackTrace();
		}
		catch(IllegalAccessException e)
		{
			e.printStackTrace();
		} catch(ClassNotFoundException e)
		{


		}



	}

	
	
	
	
	
	
	
}
